|
Cytosim
PI
Cytoskeleton Simulator
|
This is where the syntax of the config file is defined
Public Member Functions | |
| Parser (Simul &s, bool allow_set, bool allow_change, bool allow_new, bool allow_run, bool allow_write) | |
| set the permission of the parser More... | |
| virtual | ~Parser () |
| destructor | |
| void | parse_set (std::istream &) |
| parse command set More... | |
| void | parse_change (std::istream &) |
| parse command change More... | |
| void | parse_new (std::istream &) |
| parse command new More... | |
| void | parse_delete (std::istream &) |
| parse command delete More... | |
| void | parse_mark (std::istream &) |
| parse command mark More... | |
| void | parse_cut (std::istream &) |
| parse command cut More... | |
| void | parse_run (std::istream &) |
| parse command run More... | |
| void | parse_include (std::istream &) |
| parse command include More... | |
| void | parse_read (std::istream &) |
| parse command read More... | |
| void | parse_write (std::istream &) |
| parse command write More... | |
| void | parse_call (std::istream &) |
| parse command call More... | |
| void | parse_repeat (std::istream &) |
| parse command repeat More... | |
| void | parse_stop (std::istream &) |
| parse command stop More... | |
| void | parse (std::istream &, std::string const &file_name) |
| Parse a std::istream. More... | |
| void | readConfig (std::string const &name) |
| Open and parse the config file with the given name. | |
| void | readConfig () |
| Parse the default config file (SimulProp::config) | |
| void | readProperties () |
| Parse the default output property file (SimulProp::property_file) | |
Public Member Functions inherited from Interface | |
| Interface (Simul &s) | |
| associates with given Simul | |
| virtual | ~Interface () |
| destructor | |
| virtual void | hold () |
| this is called between commands during the execution process More... | |
| Property * | execute_set (std::string const &k, std::string const &n, Glossary &) |
| create a new Property of kind k from options set in Glossary More... | |
| void | execute_change (Property *, Glossary &) |
| change values in Property according to Glossary | |
| Property * | execute_change (std::string const &k, std::string const &n, Glossary &) |
| change values in Property of kind k following options set in Glossary | |
| void | change_display (std::string const &k, std::string const &n, Glossary &) |
| change 'display' (and only this) in corresponding Property More... | |
| ObjectList | execute_new (std::string const &k, std::string const &n, Glossary &) |
| create 1 Object of kind k with name n, following options in Glossary More... | |
| int | execute_new (std::string const &k, std::string const &n, unsigned cnt) |
| create 'cnt' objects of kind k with name n, randomly placed in space (no option) | |
| void | execute_delete (std::string const &k, std::string const &n, Glossary &, int cnt) |
delete cnt objects of kind k with name n, following options in Glossary More... | |
| void | execute_mark (std::string const &k, std::string const &n, Glossary &, int cnt) |
mark cnt objects of kind k with name n, following options in Glossary More... | |
| void | execute_cut (std::string const &k, std::string const &n, Glossary &) |
| cut fibers, following different options in Glossary | |
| void | execute_read (std::string const &file, unsigned index) |
| import objects from another file More... | |
| void | execute_write (std::string &file, std::string const &what, Glossary &) |
| write output file with object coordinates or information on objects More... | |
| void | execute_run (Glossary &opt, unsigned cnt, bool do_write) |
| perform simulation steps | |
Additional Inherited Members | |
Protected Attributes inherited from Interface | |
| Simul & | simul |
| associated Simul | |
|
virtual |
The configuration file should contain a succession of commands. Most command have the following syntax:
Essential commands:
| Command | Action |
|---|---|
set | Create a new Property, and set parameter values |
change | Change parameter values in an existing Property |
new | Create one or many new objects |
delete | Delete objects |
run | Perform simulation steps |
read | Read another config file |
write | export formatted data with selected object properties |
import | Import Objects from trajectory file |
export | Export all Objects to file, with their coordinates |
Other commands:
| Command | Action |
|---|---|
mark | Mark objects |
repeat | Execute code a number of times |
stop | Stop program |
cut | Cut Fibers |
call | Call a custom function |
Implements Interface.
| void parse_call | ( | std::istream & | is | ) |
Call custom function
FUNCTION_NAME should be custom?, where ? is a digit.
| void parse_change | ( | std::istream & | is | ) |
Change the value of one (or more) parameters for property NAME of class CLASS.
Short syntax:
The possible values of CLASS are in the List of objects.
The NAME should have been defined previously in the same class with set, but it is possible to use a star (*) to change all properties of the class.
| void parse_cut | ( | std::istream & | is | ) |
Cut all fibers that intersect a given plane.
NAME can be '*' to cut all fibers. The plane is specified by a normal vector n (VECTOR) and a scalar (REAL). The plane is defined by n.x + a = 0
| void parse_delete | ( | std::istream & | is | ) |
Delete objects:
NAME can be '*', and the parameters mark and position are optional.
To delete all objects of the class:
To delete all objects of specified NAME:
To delete at most CNT objects of class NAME:
To delete all objects with a specified mark:
To delete all objects within a Space:
The SPACE must be the name of an existing Space. Only 'inside' and 'outside' are valid specifications.
| void parse_include | ( | std::istream & | is | ) |
Include another specified config file, and executes it.
By default, required = 1, and execution will terminate if the file is not found. If required is set to 0, the file will be read, but execution will continue even if the file is not found.
| void parse_mark | ( | std::istream & | is | ) |
Mark objects:
NAME can be '*', and the parameter position is optional. The syntax is the same as for command delete.
| void parse_new | ( | std::istream & | is | ) |
The command new creates one or more objects with given specifications:
The possible values of CLASS are in the List of objects.
The NAME should have been defined previously in the same class with set.
The other parameters are:
| Parameter | type | Description |
|---|---|---|
| MULTIPLICITY | INTEGER | the number of objects, by default 1. |
orientation | ROTATION | a rotation applied before translation |
position | POSITION | a translation |
post_translation | VECTOR | a translation applied every time after one object is created |
post_rotation | ROTATION | a rotation applied every time after one object is created |
mark | INTEGER | this mark is given to all objects created (default = 0). |
required | INTEGER | cytosim will stop if it cannot create as many objects as specified (default=0) |
Note that position only applies to movable objects, and orientation only applies to rotatable objects. In addition, post_translation and post_rotation are relevant only if (MULTIPLICITY > 1), and do not apply to the first object.
Short syntax:
Shorter syntax:
| void parse_read | ( | std::istream & | is | ) |
Import Objects from a frame of the specified trajectory file.
by default frame = 0, corresponding to the first frame in the file.
Note that the simulation time will be changed to match the one stored in the file, but it can be reset with:
| void parse_repeat | ( | std::istream & | is | ) |
Repeat specified code.
| void parse_run | ( | std::istream & | is | ) |
Perform simulation steps, and write frames to files. Currently, only 'run simul *' is supported.
The optional specification [NB_STEPS] enables the short syntax:
| Option | Default | Action |
|---|---|---|
nb_steps | 1 | number of simulation steps |
solve | 1 | Enable/disable motion of the objects |
event | none | custom code executed stochastically with prescribed rate |
nb_frames | 0 | number of states written to trajectory file |
prune | true | Print only parameters that are different from default |
If set, event defines an event occuring at a rate specified by the positive real RATE. The action is defined by CODE, a string enclosed with parenthesis containing cytosim commands. This code will be executed at stochastic times with the specified rate.
Example:
Calling run will not output the initial state, but this can be done with write:
| void parse_set | ( | std::istream & | is | ) |
Create a new Property (a set of parameters associated with a class).
Short syntax:
CLASS should be one of the predefined object (see List of objects).
NAME can be any string, but it should start with a letter.
The command will define the given NAME for this class.
| void parse_stop | ( | std::istream & | is | ) |
Terminates execution
| void parse_write | ( | std::istream & | is | ) |
Export to file. The general syntax is:
WHAT can be state or a valid argument to report:
If * is specified instead of a file name, the current trajectory file will be used if WHAT=statee, or the standard output for a report.
The binary option only applies if WHAT=state. By default:
Short syntax:
Examples:
Attention: For safety reason, this command is disabled for play.